<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改电子名片业务填报类型配置积分明细')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-list-edit" th:object="${ecardBusiConfigList}">
        <input type="hidden" name="busiType" id="busiType" th:value="${busiType}"/>
        <input type="hidden" name="busiCode" id="busiCode" th:value="${busiCode}"/>
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">规则编号：</label>
            <div class="col-sm-8">
                <input name="configId" th:field="*{configId}" class="form-control"
                       type="text" readonly>
            </div>
        </div>
        <div id="dpsTypePerDiv" th:if="${busiCode}=='busi_per_deposit'">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">存款类型</label>
                <div class="col-sm-8">
                    <select name="dpsType" class="selectpicker form-control m-b"
                            th:with="type=${@dict.getType('ecard_busi_per_deposit_type')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{dpsType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">存款期限：</label>
                <div class="col-sm-8">
                    <select name="term" class="selectpicker form-control m-b"
                            th:with="type=${@dict.getType('ecard_busi_per_deposit_term')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{term}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div id="dpsTypePubDiv" th:if="${busiCode}=='busi_pub_deposit'">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">存款类型</label>
                <div class="col-sm-8">
                    <select name="dpsType" class="selectpicker form-control m-b"
                            th:with="type=${@dict.getType('ecard_busi_pub_deposit_type')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{dpsType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">存款期限：</label>
                <div class="col-sm-8">
                    <select id="term" name="term" class="selectpicker form-control m-b"
                            th:with="type=${@dict.getType('ecard_busi_pub_deposit_term')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{term}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div id="loanTypePerDiv" th:if="${busiCode}=='busi_per_loan'">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">贷款类型</label>
                <div class="col-sm-8">
                    <select name="loanType" class="selectpicker form-control m-b"
                            th:with="type=${@dict.getType('ecard_busi_per_loan_type')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{loanType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">贷款期限：</label>
                <div class="col-sm-8">
                    <select name="term" class="selectpicker form-control m-b"
                            th:with="type=${@dict.getType('ecard_busi_per_loan_term')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{term}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div id="loanTypePubDiv" th:if="${busiCode}=='busi_pub_loan'">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">贷款类型</label>
                <div class="col-sm-8">
                    <select id="loanType" name="loanType" class="selectpicker form-control m-b"
                            th:with="type=${@dict.getType('ecard_busi_pub_loan_type')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{loanType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">贷款期限：</label>
                <div class="col-sm-8">
                    <select name="term" class="selectpicker form-control m-b"
                            th:with="type=${@dict.getType('ecard_busi_pub_loan_term')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{term}"></option>
                    </select>
                </div>
            </div>
        </div>

        <div id="loanTypeDiv" th:if="${busiCode}=='busi_per_loan' or ${busiCode}=='busi_pub_loan'">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">利率下限(含)
                    ：</label>
                <div class="col-sm-8">
                    <input name="minRate" th:field="*{minRate}" class="form-control" required type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">利率上限
                    ：</label>
                <div class="col-sm-8">
                    <input name="maxRate" th:field="*{maxRate}" class="form-control" required type="text">
                </div>
            </div>
        </div>
        <div th:if="${busiCode}=='busi_oth_precious_metals'">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">产品类型</label>
                <div class="col-sm-8">
                    <select name="othPrdType" class="selectpicker form-control m-b"
                            th:with="type=${@dict.getType('ecard_busi_oth_prd_type')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{othPrdType}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div th:if="${busiCode}!='busi_per_social_security'">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">额度下限(含)
                    ：</label>
                <div class="col-sm-8">
                    <input name="minAmt" th:field="*{minAmt}" class="form-control" required
                           type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">额度上限
                    ：</label>
                <div class="col-sm-8">
                    <input name="maxAmt" th:field="*{maxAmt}" class="form-control" required
                           type="text">
                </div>
            </div>
        </div>
        <div th:if="${busiCode}=='busi_per_social_security'">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">社保卡类别</label>
                <div class="col-sm-8">
                    <select name="perSocialType" class="selectpicker form-control m-b"
                            th:with="type=${@dict.getType('ecard_busi_per_social_type')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                th:value="${dict.dictValue}" th:field="*{perSocialType}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">积分/比例
                ：</label>
            <div class="col-sm-8">
                <input name="nums" th:field="*{nums}" class="form-control" required
                       type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注说明
                ：</label>
            <div class="col-sm-8">
                <input name="remark" th:field="*{remark}" class="form-control"
                       type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "ecard/config/busiConfigList";
    $("#form-list-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-list-edit').serialize());
        }
    }
</script>
</body>
</html>